(function($){
	$(window).load(function(){
		
//跨域-------------------------------------------------------------------------------------------------	
	$(".shuru").blur(function(){
        	$(".xiala").hide()
        })
    $(".shuru").bind("input propertychange",function(){
    	$(".shuru").css({
    		color:"black"
    	})
    	ajax($(this).val())
    })
    	function ajax(j){
        	$.ajax({
            	type:"get",
                url:"https://suggest.taobao.com/sug",
                data:{
                	q:j,
                    area:"b2c",
                    code:"utf-8",
                    k:1,
                	bucketid:11,
                    src:"tmall_pc"
                },
                dataType:"jsonp",
               
				dataFilter:function(data,type){
						
					return data;
						},
						success:function(data){
							
							//li的个数为
							var oLi=data.result.length
							
							if(oLi==0){
								$('.xiala').hide()
							}else{
								$('.xiala').show()
								$('.xiala').empty()
								for(var i=0;i<oLi;i++){
									var pLi=$('<li><span class="span-left">'+data.result[i][0]+'</span><span class="span-right">'+'约有'+data.result[i][1]+'结果'+'</span></li>')
									$('.xiala').append(pLi)
								}
								
							}
						}
			})
        }

 //分类的下拉菜单------------------------------------------------------------------------------
$(".fenlei").toggle(function(){

	$(".fenlei img").attr("src","images/fenlei.gif")
	//$(".fenlei-xiala").css("display","block")
	$(".fenlei-xiala").fadeIn(1000)
	
},function(){
	$(".fenlei img").attr("src","images/fenlei.png")
	$(".fenlei-xiala").fadeOut()
})

//var i=-10000;
$(".leftli").mouseenter(function(){
	//i++;
	//$(this).children('div').css({"display":"block","z-index":i})
	for(var j=0;j<$(".leftli").length;j++){
	$(".leftli").eq(j).css({"background":"none"})
	$(".leftli").eq(j).children('div').css({"display":"none"})
	}
	$(this).css({"background":"url(images/xllbg.png) no-repeat"})
	$(this).children('div').css({"display":"block"})
})
$(".leftli").mouseenter(function(){
	
	for(var j=0;j<$(".bianse").length;j++){
	$(".bianse").eq(j).css({"color":"black"})
	}
	$(this).children(".bianse").css({"color":"white"})
})

 
 
  //点击按钮------------------------------------------------------------------------------
 var aBtn=$(".btn-list a");
 var aBanner=$(".ban-center img");
 var iIndex=0;

 aBtn.click(function(){
 	iIndex=$(this).index();
 	bannerMove(iIndex);
 });
 //往左移动------------------------------------------------------------------------------
 $(".banner").mouseenter(function(){
 	$(".switch-btn").css("display","block");
 }).mouseleave(function(){
 	$(".switch-btn").css("display","none");
 })
 $(".left-btn").click(function(){
 	iIndex--;
 	if(iIndex<0){
 		iIndex=aBanner.length-1;
 	}
 	bannerMove(iIndex);
 })
 // 往右运动------------------------------------------------------------------------------
$('.right-btn').click(function() {
	iIndex++;
	if(iIndex >= aBanner.length) {
		iIndex = 0;
	}
	bannerMove(iIndex);
	bannerbgMove(iIndex);
});
// 清除定时器------------------------------------------------------------------------------
		$('.banner').hover(function () {
			clearInterval(oBannerTime);
		}, function () {
			autoMove();
		});
 // 自动轮播------------------------------------------------------------------------------
		autoMove();
		function autoMove() {
			oBannerTime = setInterval(function () {
				iIndex++;
				if(iIndex >= aBanner.length) {
					iIndex = 0;
				}
				bannerMove(iIndex);
			}, 3000);
		}

 function bannerMove(iIndex){
 	aBtn.removeClass("active").eq(iIndex).addClass("active");
 	aBanner.stop(true).animate({opacity:0},300,function(){
 		$(this).css("display","none");
 	}).eq(iIndex).css("display","block").stop(true).animate({opacity:1},200);
 }

//mc-1图片向上动 ------------------------------------------------------------------------------
 $(".mc-1 a").mouseenter(function(){
 	k=$(this).index();
 	$(this).stop(true).animate({
 		marginTop:'5px',
 	},300)
 }).mouseleave(function(){
 	$(this).stop(true).animate({
 		marginTop:'20px',
 	},300)
 })
 
 //mc-3 图片的浮动------------------------------------------------------------------------------
 $(".mc3-left").mouseenter(function(){
 	$(".mc3-left img").stop(true).animate({"top":"-10px"});
 }).mouseleave(function(){
 	$(".mc3-left img").stop(true).animate({"top":"0"});
 })
 $(".mc3-right img").mouseenter(function(){
 	for(var s=0;s<$(".mc3-right img").length;s++){
 		$(".mc3-right img").eq(s).stop(true).animate({"top":"0"},300);
 	}$(this).stop(true).animate({"top":"-15px"},300);
 })
 $(".mc3-right").mouseleave(function(){
 	for(var s=0;s<$(".mc3-right img").length;s++){
 		$(".mc3-right img").eq(s).stop(true).animate({"top":"0"},300);
 	}
 })
 
 //mc-5透明度------------------------------------------------------------------------------
 $(".mc-5 img").mouseenter(function(){
 	for(var s=0;s<$(".mc-5 img").length;s++){
 		$(".mc-5 img").eq(s).stop(true).animate({"opacity":"1"},300);
 	}$(this).stop(true).animate({"opacity":"0.6"},300);
 })
 $(".mc-5 img").mouseleave(function(){
 	for(var s=0;s<$(".mc-5 img").length;s++){
 		$(".mc-5 img").eq(s).stop(true).animate({"opacity":"1"},300);
 	}
 })
 
 //mc-6放大-----------------------------------------------------------------------------------------
 $(".box").mouseenter(function(){
 	var b=$(this).index();
 	for(var s=0;s<$(".box").length;s++){
 		$(".box-left img").animate({"width":"418px","height":"260px","top":"0","left":"0"})
 	}$(".box-left img").eq(b).stop(true).animate({"width":"468px","height":"310px","top":"-25px","left":"-25px"})
 }).mouseleave(function(){
 	for(var s=0;s<$(".box").length;s++){
 		$(".box-left img").animate({"width":"418px","height":"260px","top":"0","left":"0"})
 		}
 	})
 
 //倒计时----------------------------------------------------
 var time=1000000;
 
 setInterval(function(){
 var aTime=document.getElementsByClassName("time");
 var day=Math.floor(time/24/60/60);
 var hour=Math.floor(time%(24*3600)/3600);
 var min=Math.floor(time%(24*3600)%3600/60);
 var sec=Math.floor(time%(24*3600)%3600%60);
 var shijian=hour+":"+min+":"+sec;
 time--;
 for(var q=0;q<aTime.length;q++){
 aTime[q].innerHTML=shijian;}
 },1000)
 
 //mc6-right图片shadow----------------------------------------------------
 $(".hotb").mouseenter(function(){
 	var Hindex=$(this).index();
 	for(var s=0;s<$(".hotb").length;s++){
 		$(".hotb").css("box-shadow","")
 		$(".touming").css("display","none")
 	}
 	$(".hotb").eq(Hindex).css("box-shadow","0 0 5px #888");
 	$(".touming").eq(Hindex).css("display","block");
 }).mouseleave(function(){
 	for(var s=0;s<$(".hotb").length;s++){
 		$(".hotb").css("box-shadow","")
 		$(".touming").css("display","none")
 	}
 })
 $(".zhuanti a").mouseenter(function(){
 	var Hindex=$(this).index();
 	for(var s=0;s<$(".zhuanti a").length;s++){
 		$(".zhuanti a").css("box-shadow","")
 	}
 	$(".zhuanti a").eq(Hindex).css("box-shadow","0 0 5px #888");
 }).mouseleave(function(){
 	for(var s=0;s<$(".zhuanti a").length;s++){
 		$(".zhuanti a").css("box-shadow","")
 	}
 })
 
 
 //侧边栏滑动效果----------------------------------------------------
 $(".kefu").mouseenter(function(){
 	$(".user-hide").css({"display":"block"})
 	$(".user-hide").stop(true).animate({"opacity":"1","right":"30px"})
 }).mouseleave(function(){
 	$(".user-hide").css({"display":"none"})
 	$(".user-hide").stop(true).animate({"opacity":"0","right":"55px"})
 })
 
  $(".gouwudai").mouseenter(function(){
 	$(".gouwudai").css({"background":"url(images/common.png) no-repeat -35px -121px"})
 }).mouseleave(function(){
 	$(".gouwudai").css({"background":"url(images/common.png) no-repeat 0 -121px"})
 })
 
  $(".xin").mouseenter(function(){
 	$(".shoucang-hide").eq(0).css({"display":"block"})
 	$(".xin").css({"background":"url(images/common.png) no-repeat  -35px -242px"})
 	$(".shoucang-hide").eq(0).stop(true).animate({"opacity":"1","right":"30px"})
 }).mouseleave(function(){
 	$(".shoucang-hide").eq(0).css({"display":"none"})
 	$(".xin").css({"background":"url(images/common.png) no-repeat 0 -242px"})
 	$(".shoucang-hide").eq(0).stop(true).animate({"opacity":"0","right":"55px"})
 })
 
   $(".juan").mouseenter(function(){
 	$(".shoucang-hide").eq(1).css({"display":"block"})
 	$(".juan").css({"background":"url(images/common.png) no-repeat  -35px -274px"})
 	$(".shoucang-hide").eq(1).stop(true).animate({"opacity":"1","right":"30px"})
 }).mouseleave(function(){
 	$(".shoucang-hide").eq(1).css({"display":"none"})
 	$(".juan").css({"background":"url(images/common.png) no-repeat 0 -274px"})
 	$(".shoucang-hide").eq(1).stop(true).animate({"opacity":"0","right":"55px"})
 })
 
   $(".saoma").mouseenter(function(){
 	$(".saoma-hide").css({"display":"block"})
 	$(".saoma").css({"background":"url(images/common.png) no-repeat  -35px -306px"})
 	$(".saoma-hide").stop(true).animate({"opacity":"1","right":"30px"})
 }).mouseleave(function(){
 	$(".saoma-hide").css({"display":"none"})
 	$(".saoma").css({"background":"url(images/common.png) no-repeat 0 -306px"})
 	$(".saoma-hide").stop(true).animate({"opacity":"0","right":"55px"})
 })
 
 $(".uptop").mouseenter(function(){
 	$(".uptop").css({"background":"url(images/common.png) no-repeat  -35px -338px"})
 }).mouseleave(function(){
 	$(".uptop").css({"background":"url(images/common.png) no-repeat 0 -338px"})
 }).click(function(){
 	$("html,body").animate({"scrollTop":"0"},800)
 })

//列表页li的单个商品效果----------------------------------------------------
 $(".list-box").mouseenter(function(){
 	$(".list-box").css("box-shadow","")
 	$(this).css("box-shadow","0 0 10px #888");
 }).mouseleave(function(){
 		$(".list-box").css("box-shadow","")
 })
 
 
 $(".list-box").mouseenter(function(){
 		$(this).children(".while-link").children(".tupian").animate({"width":"270px","height":"270px","top":"0","left":"0"})
 		$(this).children(".while-buy").css({"background":"url(images/common.png) no-repeat -72px -112px"})
 		$(this).children(".while-link").children('.tupian').stop(true).animate
 		({"width":"280px","height":"280px","top":"-5px","left":"-5px"})
 	$(this).children(".while-buy").css({"background":"url(images/common.png) no-repeat -133px -112px"})
 }).mouseleave(function(){
 		$(".tupian").animate({"width":"270px","height":"270px","top":"0","left":"0"})
 		$(".while-buy").css({"background":"url(images/common.png) no-repeat -72px -112px"})
 		
 	})
 
//reg判断条件----------------------------------------------------
$(".phone-text").each(function(i,value){
	$(this).focus(function(){
		$('.reg-one').eq(i).css({"border":"2px solid #ccc","margin":"29px -1px -1px"})
	})	
})
$(".phone-text").eq(2).blur(function(){
	$('.reg-one').eq(2).css({"border":"1px solid #ccc","margin-top":"30px"})
})
 var pattren1=/^(13[0-9]|15[0|2|3|6|7|8|9]|18[8|9])\d{8}$/;
 //收货信息手机号
 $(".input2").blur(function(){
 	if(pattren1.test($(".input2").val())){		
 		$(".error2").css("display","none")
 	}else{
 		$(".error2").css("display","inline")
 	}
 })
 $(".input4").blur(function(){
 	if(!$(".input4").val()==""){		
 		$(".error4").css("display","none")
 	}else{
 		$(".error4").css("display","inline")
 	}
 })
 $(".input1").blur(function(){
 	if(!$(".input4").val()==""){		
 		$(".error1").css("display","none")
 	}else{
 		$(".error1").css("display","inline")
 	}
 })
 var pattren6=/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/;
  $(".input3").blur(function(){
 	if(pattren6.test($(".input3").val())){		
 		$(".error3").css("display","none")
 	}else{
 		$(".error3").css("display","inline")
 	}
 })
  
$(".phone-text").eq(0).blur(function(){
	
	if($(".phone-text").eq(0).val()==""){
		$('.reg-one').eq(0).css({"border":"2px solid #e10482","margin":"29px -1px -1px"})
		$(".tips-judge").eq(0).css("display","block")
		$(".error-tips").eq(0).html("请输入手机号")
	}else if(pattren1.test($(".phone-text").eq(0).val())==true){
		$('.reg-one').eq(0).css({"border":"1px solid #ccc","margin-top":"30px"})
		$(".tips-judge").eq(0).css("display","none")
	}else{
		$('.reg-one').eq(0).css({"border":"2px solid #e10482","margin":"29px -1px -1px"})
		$(".tips-judge").eq(0).css("display","block")
		$(".error-tips").eq(0).html("请输入正确格式的手机号")
	}
})

	var pattern3=/\w{6,16}/;
	var pattern5=/\s/g;
$(".phone-text").eq(1).blur(function(){

	if($(".phone-text").eq(1).val()==""){
		$('.reg-one').eq(1).css({"border":"2px solid #e10482","margin":"29px -1px -1px"})
		$(".tips-judge").eq(1).css("display","block")
	}else if(pattern3.test($(".phone-text").eq(1).val())&&pattern5.test($(".phone-text").eq(1).val())==false){
		$('.reg-one').eq(1).css({"border":"1px solid #ccc","margin-top":"30px"})
		$(".tips-judge").eq(1).css("display","none")
	}else{
		$('.reg-one').eq(1).css({"border":"2px solid #e10482","margin":"29px -1px -1px"})
		$(".tips-judge").eq(1).css("display","block")
	}
})

var pattren2=/^[0-9]{4}$/;
$(".phone-text").eq(2).blur(function(){

	if($(".phone-text").eq(2).val()==""){
		$('.reg-one').eq(2).css({"border":"2px solid #e10482","margin":"29px -1px -1px"})
		$(".tips-judge").eq(2).css("display","block")
	}else if(pattren2.test($(".phone-text").eq(2).val())==true){
		$('.reg-one').eq(2).css({"border":"1px solid #ccc","margin-top":"30px"})
		$(".tips-judge").eq(2).css("display","none")
	}else{
		$('.reg-one').eq(2).css({"border":"2px solid #e10482","margin":"29px -1px -1px"})
		$(".tips-judge").eq(2).css("display","block")
	}
})
$(".phone-text").keyup(function(){
	if(
	pattren1.test($(".phone-text").eq(0).val())
	&&pattren2.test($(".phone-text").eq(2).val())
	&&pattern3.test($(".phone-text").eq(1).val())
	&&pattern5.test($(".phone-text").eq(1).val())==false
    )
	{
	$(".goto").css("cursor","pointer")
	$(".goto span").css("cursor","pointer")
}

})

var data = new Date();
	$('.yanzheng').attr("src","http://www.cnrmall.com/cnraptcha.jpg?time="+data.getMilliseconds())
$('.reg-one a').click(function(){
		data = new Date();
		$('.yanzheng').attr("src","http://www.cnrmall.com/cnraptcha.jpg?time="+data.getMilliseconds())
	})

//注册页面cookie----------------------------------------------------
$(".goto span").click(function(){
	if(
	pattren1.test($(".phone-text").eq(0).val())
	&&pattren2.test($(".phone-text").eq(2).val())
	&&pattern3.test($(".phone-text").eq(1).val())
	&&pattern5.test($(".phone-text").eq(1).val())==false
    ){
	setCookie("userName",$(".shoujizhi").next().val(),1);
	setCookie("mima",$(".mimazhi").next().val(),1);
	window.location.href="2denglu.html";}
})
//购物车cookie----------------------------------------------------
$(".car-btn").click(function(){
	setCookie("small-a1",$(".small-a1 img").attr("src"),1);
	setCookie("pro-name",$(".pro-name").html(),1);
	setCookie("pro-min",$(".pro-min").html(),1);
	setCookie("place",$(".place").html(),1);
	setCookie("buynum",$(".buynum").val(),1);
	$("#buynum").html("1")
})
//图片移动到侧边栏
$(".car-btn").click(function(){
	
	var oImg=$('<img class="move-img" src="images/link1.jpg" />')
	
	$(".car-btn").append(oImg);
	var x=$("#buynum").offset().left-$(".move-img").offset().left
	var y=$("#buynum").offset().top-$(".move-img").offset().top
	
	$(".move-img").stop(true).animate({
		left:x+'px',
		top:y+'px'
	},function(){
		$(this).hide()
	})
})

//点击购物带跳转----------------------------------------------------
$(".gouwudai").click(function(){
	window.open("6shopcar.html");
})
//购物车有物品时显示----------------------------------------------------
if(getCookie("pro-name")&&getCookie("pro-min")&&getCookie("place")){
	$(".nothing").css("display","none")
	$(".title").css("display","block")
	$(".cart-foot").css("display","block")
	$(".title-b label").html(getCookie("place"))
	$(".goods-img img").attr("src",getCookie("small-a1"))
	$(".goods-info a").html(getCookie("pro-name"))
	$(".buynumt").val(getCookie("buynum"))
	$(".price1").html(getCookie("pro-min"))
	$(".xiaoji").html("$"+getCookie("pro-min")*getCookie("buynum"))
	$(".pay-amount").html($(".xiaoji").html())
	
}else{
	$(".nothing").css("display","block")
	$(".title").css("display","none")
	$(".cart-foot").css("display","none")
}
//购物车没有物品----------------------------------------------------
$(".add-address").click(function(){
	window.location="3index.html"
})
//全选按钮勾选问题----------------------------------------------------
$(".quanxuan").click(function(){
	if($(".quanxuan").attr("checked")=="checked"){
		$(".pay-amount").html($(".xiaoji").html())
		$(".buy-kuang").attr("checked","checked")
		$(".buy-sel").attr("checked","checked")
	}else{
		$(".pay-amount").html("00.00")
		$(".buy-kuang").removeAttr("checked","checked")
		$(".buy-sel").removeAttr("checked","checked")
	}
})
//购物车删除物品----------------------------------------------------
$(".remove").click(function(){
	delCookie("place")
	delCookie("small-a1")
	delCookie("pro-name")
	delCookie("buynum")
	delCookie("pro-min")
	$("#buynum").html("0")
	if(getCookie("pro-name")&&getCookie("pro-min")&&getCookie("place")){
	$(".nothing").css("display","none")
	$(".title").css("display","block")
	$(".cart-foot").css("display","block")
	$(".title-b label").html(getCookie("place"))
	$(".goods-img img").attr("src",getCookie("small-a1"))
	$(".goods-info a").html(getCookie("pro-name"))
	$(".buynumt").val(getCookie("buynum"))
	$(".price1").html(getCookie("pro-min"))
	$(".xiaoji").html("$"+getCookie("pro-min")*getCookie("buynum"))
	$(".pay-amount").html($(".xiaoji").html())
	
}else{
	$(".nothing").css("display","block")
	$(".title").css("display","none")
	$(".cart-foot").css("display","none")
}
})
//保存地址
$(".queren").click(function(){
	setCookie("shoujianren",$(".input4").val(),1);
	setCookie("xxdz",$(".input1").val(),1);
	setCookie("iphone",$(".input2").val(),1);
	setCookie("id",$(".input3").val(),1);
	setCookie("add5",$(".input5").val(),1);
	setCookie("add6",$(".input6").val(),1);
	setCookie("add7",$(".input7").val(),1);
	$(".mengban").css("display","none");
 	$(".zhuce-mes").css("display","none");
 	var a=$("<li class='address-list del '><div class='user-name'><strong></strong><span></span></div><div class='user-place'><p class='dizhi'></p><p class='dizhi2'></p></div><div class='id'>身份证号：<span class='id-num'></span></div><div class='add-operate'><a href='javascript:;'><img src='images/add.png'/></a></div></li>")
 	$(".addrList").prepend(a)
 	$(".user-name strong").html(getCookie("shoujianren"))
 	$(".user-name span").html(getCookie("iphone"))
 	$(".dizhi").html(getCookie("add5")+getCookie("add6")+getCookie("add7"))
 	$(".dizhi2").html(getCookie("xxdz"))
 	$(".id-num").html(getCookie("id"))
})

if(getCookie("shoujianren")){
	var a=$("<li class='address-list del'><div class='user-name'><strong></strong><span></span></div><div class='user-place'><p class='dizhi'></p><p class='dizhi2'></p></div><div class='id'>身份证号：<span class='id-num'></span></div><div class='add-operate'><a href='javascript:;'><img src='images/add.png'/></a></div></li>")
 	$(".addrList").prepend(a)
 	$(".user-name strong").html(getCookie("shoujianren"))
 	$(".user-name span").html(getCookie("iphone"))
 	$(".dizhi").html(getCookie("add5")+getCookie("add6")+getCookie("add7"))
 	$(".dizhi2").html(getCookie("xxdz"))
 	$(".id-num").html(getCookie("id"))
}else{
	$(".del").css("display","block")
}


//登录页面----------------------------------------------------
 $(".login-nav li").each(function(i,value){
 	$(this).click(function(){
	 	$(".login-nav li").attr("class","")
	 	$(".login-three").css("display","none")
		$(this).attr("class","current")
		$(".login-three").eq(i).css("display","block")
	})
})
$(".denglu").click(function(){
	if($(".sjh").val()==getCookie("userName")&&$(".mm").val()==getCookie("mima")){
		window.location.href="3index.html";
	}
})
//index改名字----------------------------------------------------
if(getCookie("userName")){
	$(".huanying").css({"display":"block","float":"left"})
	$(".zhuce").css("margin-right","700px")
	$(".denglu").html("15236218622")
	$(".zhuce").html("退出")
	
}
$(".zhuce").click(function(){
	delCookie("userName");
	if(getCookie("userName")==false){
		$(".huanying").css({"display":"none"})
		$(".zhuce").css("margin-right","750px")
		$(".denglu").html("登录")
		$(".zhuce").html("注册")
	}
})
//详情页图片效果----------------------------------------------------
 $(".small-list li").mouseenter(function(){
 	 a=$(this).index()
	$(".bigimg").attr("src","images/link1"+$(this).index()+".jpg")
	$(".fangda img").attr("src","images/link1"+$(this).index()+".jpg")
 	$(".small-list a").css("border","1px solid #efefef")
 	$(this).children().css("border","1px solid black")
 })
var count=1
$(".btn-plus").click(function(){
	count++
	$(".buynum").val(count)
})
$(".btn-minus").click(function(){
	
	
	if(count<=1){
		count=1;
	}else{
		count--
		$(".buynum").val(count)
	}
}) 

//购物车加减物品数量价钱的变化----------------------------------------------------
var a=getCookie("buynum")
$(".btn-plus1").click(function(){
	a++
	$(".xiaoji").html("$"+getCookie("pro-min")*a)
	$(".pay-amount").html($(".xiaoji").html())
	$(".buynumt").val(a)
})
$(".btn-minus1").click(function(){
	if(a<=1){
		a=1;
		$(".xiaoji").html("$"+getCookie("pro-min")*a)
		$(".pay-amount").html($(".xiaoji").html())
	}else{
		a--
		$(".xiaoji").html("$"+getCookie("pro-min")*a)
		$(".pay-amount").html($(".xiaoji").html())
		$(".buynum").val(a)
	}
}) 

//稿费说明效果----------------------------------------------------
 $(".price-terms a").mouseenter(function(){
 //	if($(".price-terms-show").css('display')=="none"){
 		$(".price-terms-show").stop(true,true).slideDown({"height":"70px"})
 //	}
 	
 }).mouseleave(function(){
// 	if($(".price-terms-show").css('display')=="block"){
 		$(".price-terms-show").stop(true,true).slideUp({"height":"0px"})
 //	}
 })
 
 //商品详情介绍和评论之间的切换----------------------------------------------------
 $(".pro-intro-h li").click(function(){
 	 $(".pro-intro-h li").removeClass("h-active");
 	 $(this).addClass("h-active")
 })
 $(".pro-intro-h li").eq(0).click(function(){
 	$(".spxq").css("display","block");
 	$(".commentBox").css("display","none")
 })
  $(".pro-intro-h li").eq(1).click(function(){
 	$(".spxq").css("display","none");
 	$(".commentBox").css("display","block")
 	$(".mod-main").css("height","1400px")
 })

 //评论内容获取ajax----------------------------------------------------
 $(".btn-comment").click(function(){
 	$.ajax({
 		type:"get",
 		url:"../pinglun.json",
 		async:true,
 		dataType:"json",
 	});
 	console.log($.ajax)
 })
 
 //地址管理蒙版
 $(".close").click(function(){
 	$(".mengban").css("display","none")
 	$(".zhuce-mes").css("display","none")
 })
  $(".indent-a").click(function(){
 	$(".mengban").css("display","block")
 	$(".zhuce-mes").css("display","block")
 })
  $(".quxiao").click(function(){
 	$(".mengban").css("display","none")
 	$(".zhuce-mes").css("display","none")
 })
  $(".indent-a").click(function(){
 	$(".mengban").css("display","block")
 	$(".zhuce-mes").css("display","block")
 })
 
 //放大镜
 $('.pro-img').mouseenter(function(){
 	$('.fangda').css("display","block")
   	$('.small-fangda').css("display","block")
   	$(this).mousemove(function(e){
   		var b=e||event
   		var moveTop=b.pageY-$('.pro-img').offset().top-$('.small-fangda').height()/2
   		var moveLeft=b.pageX-$('.pro-img').offset().left-$('.small-fangda').width()/2
   		if(moveTop<$('.small-fangda').height()/2){
 				moveTop=0
   		}else if(moveTop>$('.pro-img').height()-$('.small-fangda').height()){
   				moveTop=$('.pro-img').height()-$('.small-fangda').height()-2
   		}
   		if(moveLeft<$('.small-fangda').width()/2){
 				moveLeft=0
   		}else if(b.pageX>$('.pro-img').offset().left+$('.pro-img').width()-$('.small-fangda').width()/2){
   				moveLeft=$('.pro-img').width()-$('.small-fangda').width()-2
   		}
   		$(".small-fangda").css({"top":moveTop,"left":moveLeft})
   		$(".fangda img").css({"top":-5*moveTop,"left":-5*moveLeft})
   	})
 }).mouseleave(function(){
   	$('.fangda').css("display","none")
   	$('.small-fangda').css("display","none")
 })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
	})
})(jQuery)
